require 'permissionable_attributes_code_generator'
require 'bit_accessor'
module PermissionableAttributes
  module ClassMethods
    def has_attributes_with_permissions
      code_generator = PermissionableAttributesCodeGenerator.new(self)
      raise "You must pass has_attributes_with_permissions a block and define your attributes and permissions." unless block_given?
      yield code_generator 
      code_generator.generate
    end
  end
  
  def self.included(receiver)
    receiver.extend ClassMethods
  end
end
